package com.iavstream.utility;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class StreamAddressStuff {	
	
	private static final String UserName = "chasefeng";
	private static final String UserPwd = "fsqdsj2014";	
	
    public StreamAddressStuff ()
    {
    	
    }

	public String loaduserpwd(String content) {		
		String str = null;
		String rtsp = new String("rtsp://");		
		//get the sub string
		str=rtsp+UserName+":"+UserPwd+"@"+content.substring(7);		
		return str;		
	}

    public String GetInetAddress(String  host){
		String IPAddress = ""; 
		InetAddress ReturnStr1 = null;
		try {
			ReturnStr1 = java.net.InetAddress.getByName(host);
			IPAddress = ReturnStr1.getHostAddress();
			System.out.println(IPAddress);
		} catch (UnknownHostException e) {
			e.printStackTrace();
			return  IPAddress;
		}
		return IPAddress;
	}
    
	
}